﻿

using SqlSugar;

namespace MQTT.Server.GlobalConfig
{
    /// <summary>
    /// 应用程序配置
    /// </summary>
    public class AppConfig
    {
        /// <summary>
        /// 数据库类型
        /// </summary>
        public DbType Type { get; set; } = DbType.Sqlite;

        /// <summary>
        /// 数据库字符串
        /// </summary>
        public string ConnectionString { get; set; } = "Data Source=|DataDirectory|\\mqttdb.db; Pooling=true;Min Pool Size=1";

        /// <summary>
        /// 创建数据库
        /// </summary>
        public bool CreateDb { get; set; } = true;


        /// <summary>
        /// 初始化表结构
        /// </summary>
        public bool SyncStructure { get; set; } = true;

        /// <summary>
        /// AOP监听数据库操作
        /// </summary>
        public bool ListenDatabase { get; set; } = true;

        /// <summary>
        /// 同步数据-初始化数据
        /// </summary>
        public bool SyncData { get; set; }

        /// <summary>
        /// mqtt 端口
        /// </summary>
        public int TcpPort { get; set; } = 9091;

        /// <summary>
        /// ws 端口 / API PORT
        /// </summary>
        public int APIPort { get; set; } = 9092;

        /// <summary>
        /// ws 路由
        /// </summary>
        public string WebSocketPath { get; set; } = "mqtt";

        /// <summary>
        /// DES密钥
        /// </summary>
        public string DesEncryptKey { get; set; } = "shineyoung.com";

        /// <summary>
        /// ws 路由
        /// </summary>
        public string UserName { get; set; } = "shineyoung";

        /// <summary>
        /// DES密钥
        /// </summary>
        public string Password { get; set; } = "7D218707F390F60F47B68374D7152A0E";

        /// <summary>
        /// 客户端ID
        /// </summary>
        public string ClientID { get; set; } = "00000000-0000-0000-0000-000000000000";
    }
}
